<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  header("location:checklogin.php");
}
$purchseArray = array();
$i = 0;
$selectPurchse = "SELECT purchaseMasterId,partyName,DATE_FORMAT(purchaseDate,'%d-%m-%Y') AS purchaseDate
                     FROM  purchasemaster
                   LEFT JOIN  party ON party.partyId = purchasemaster.partyId
                   WHERE status = 'P'
                   ORDER BY purchaseMasterId";
$selectPurchseRes = mysql_query($selectPurchse);
while($purchaseRow = mysql_fetch_array($selectPurchseRes))
{
  $purchseArray[$i]['purchaseMasterId']   = $purchaseRow['purchaseMasterId'];
  $purchseArray[$i]['partyName']          = $purchaseRow['partyName'];
  $purchseArray[$i]['purchaseDate']       = $purchaseRow['purchaseDate'];
  $i++;
}

include("./bottom.php");
$smarty->assign("purchseArray",$purchseArray);  
$smarty->display('purchaseReport.tpl');
?>